package cn.bdqn.t354.service.impl;

import cn.bdqn.t354.mapper.RoleRightMapper;
import cn.bdqn.t354.pojo.RoleRight;
import cn.bdqn.t354.service.RoleRightService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class RoleRightServiceImpl implements RoleRightService {
    @Resource
    RoleRightMapper roleRightMapper;

    @Override
    public int addRoleRight(RoleRight roleRight) {
        return roleRightMapper.insert(roleRight);
    }

    @Override
    public int deleteByRoleId(Long roleId) {
        QueryWrapper<RoleRight> qw=new QueryWrapper<>();
        qw.eq("rf_role_id",roleId);
        return roleRightMapper.delete(qw);
    }
}
